package main

import "fmt"

//定义一个接口类型
type Humaner interface{
	sayHi()
}

type Teacher struct {
	name string
	age int
}

func (temp *Teacher) sayHi(){
	fmt.Println("say hi,my name is",temp.name)
}

func main (){
	var t Humaner;
	//必须传&地址
	t = &Teacher{"Tom",20}
	t.sayHi()
}